package com.cjw.controller.operationAnalysis;

import com.cjw.config.annotation.OperationLogAnnotation;
import com.cjw.pojo.dto.operationAnalysis.AccessDTO;
import com.cjw.pojo.dto.operationAnalysis.BarDTO;
import com.cjw.service.operationAnalysis.ResourceAccessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : cjw
 * @date: : 2022/3/17 21:40
 * @description : 资源访问分析接口
 */
@RestController
@RequestMapping("/admin/resource/access")
@Api("资源访问分析接口")
public class ResourceAccessController {
    @Autowired
    private ResourceAccessService resourceAccessService;

    @GetMapping("/requestBar")
    @ApiOperation("查看请求占比")
    @OperationLogAnnotation(operModul = "运营情况分析-资源访问分析",operType = "查看请求占比",operDesc = "查询")
    public List<BarDTO> getRequestBar() {
        return resourceAccessService.getRequestBar();
    }

    @GetMapping("/access")
    @ApiOperation("查看各模块访问情况")
    @OperationLogAnnotation(operModul = "运营情况分析-资源访问分析",operType = "查看各模块访问情况",operDesc = "查询")
    public List<AccessDTO> access() {
        return resourceAccessService.access();
    }
}
